home *** CD-ROM | disk | FTP | other *** search
/ BBS Toolkit / BBS Toolkit.iso / qbbs / rabat.zip / FDRA.BAT
DOS Batch File  |  1992-01-14  |  7KB  |  311 lines

  1. @echo OFF
  2. REM 
  3. REM 
  4. rem ... A FrontDoor/RemoteAccess batchfile by T. Graves - 159/500
  5. rem ... set default drive here and before every questionable return to RA
  6. rem ... in an interactive scenario like this, repeating the drive setting
  7. rem ... is not overkill.
  8. rem ... Note especially that this batch file may be restarted without the 
  9. rem ... modem being re-initialized at any point in the batch file where 
  10. rem ... there is a flag (ie: :HERE).  
  11. rem ... If an outside function fails, you may restart your user by typing:
  12. rem ... FDRA RESTART-RA and that will bring the same user right back online.
  13. rem ... Every routine in this batch file may be tested the same way.
  14. REM
  15. REM The Original Structures and Idea of this .BAT File
  16. REM Are the Ideas by Tracy Graves
  17. REM Tracy can be reached at FidoNet Node 1:159/500 
  18. REM Phone 1-517-337-0624
  19. REM 
  20. REM This .BAT File was converted to work with the following programs:
  21. REM Andrew Milner's - Remote Access 1.10+
  22. REM David Nugent's - BNU
  23. REM FrontDoor - By "In Dispute" - Sorry JoHo
  24. REM Imail 1.21 - by I forget. Damn good program though.
  25. REM Scan - MacAfee
  26. REM DLC150.zip - Download Counter - I'll look it up in a minute
  27. REM I Think That's it...
  28. REM All Above mentioned programs are available on Delphi, in the BBS SIG
  29. REM 
  30. REM 
  31. REM All Credit for this file should go to Tracy Graves from
  32. REM the file RA-KIT1.ZIP, Which is (or will be shortly) in the BBS SIG also.
  33. REM You should get the above mentioned file if you are new to setting up a 
  34. REM RA BBS. It just May save your sanity.
  35. REM
  36. cls
  37.  REM What drive is the System Using?
  38.  :C:
  39.  REM Don't Forget to set the Environment Variables
  40.  set RA=C:\RA
  41.  set FD=C:\FD
  42. :START
  43.  REM OK Folks, Let's Get Busy!
  44.  REM Using David Nugent's BNU Fossil Driver Here.
  45.  REM Let's Give ourselves a little room to work.
  46.   BNU /R=1024 /T=512
  47.    REM OK, Now let BNU Toggle the port to make sure it's clear.
  48.   BNU /I1-
  49.  BNU /I1+ /F+
  50.  cls
  51.  REM Clear the Screen, Reset the Modem, and make sure it's On Hook
  52.  REM I Use Com2 Here and up ther in the BNU Statements 
  53.  REM With BNU, COM1=0 (Default) , COM2=1, etc...
  54.  ECHO ATZ>COM2:
  55.  ECHO ATH0>COM2:
  56.  echo.    
  57.  echo.
  58.  echo.  
  59.  echo.  
  60.  echo.  
  61.  echo.  
  62.  echo.  
  63.  echo.  
  64.  echo.  
  65.  echo.  
  66.  echo.  
  67.  echo.  
  68.  echo.  
  69.  echo       -------------- FrontDoor ---- RemoteAccess ------------------
  70.  :C:
  71.  cd \RA
  72. :runfdra
  73.  cd \fd
  74.  FD 
  75. :AFTER-FD
  76.  REM Let's catch those ErrorLevels From FrontDoor
  77.  if errorlevel 238 goto 19200_BBS
  78.  if errorlevel 219 goto 19200_BBS
  79.  if errorlevel 196 goto 9600_BBS
  80.  if errorlevel 124 goto 2400_BBS
  81.  if errorlevel 112 goto 1200_BBS
  82.  if errorlevel 103 goto 300_BBS
  83.  if errorlevel 100 goto LOCALBBS
  84.  if errorlevel  90 goto SCANECHO
  85.  if errorlevel  80 goto TOSSNET
  86.  if errorlevel  70 goto UNPACKMAIL
  87.  if errorlevel  60 goto CLEANUP
  88.  if errorlevel  55 goto DAILY
  89.  if errorlevel  50 goto RA
  90.  if errorlevel  11 goto START
  91.  if errorlevel  10 goto END
  92.  if errorlevel   6 goto FOSSIL
  93.  if errorlevel   5 goto MODEMINIT
  94.  if errorlevel   4 goto MODEMRESP
  95.  if errorlevel   3 goto FULLDISK
  96.  if errorlevel   2 goto EXTERNAL
  97.  if errorlevel   1 goto INTERNAL
  98.   goto start
  99.  
  100. rem ***** FrontDoor executes BBS for human callers baud rate/errorlevels *****
  101. :19200_BBS
  102.  :C:
  103.  cd\RA
  104.  RA.exe -n1 -b19200 -E0
  105.  goto AFTER-RA
  106.  
  107. :9600_BBS
  108.  :C:
  109.  cd\RA
  110.  RA.exe -n1 -b9600 -E0
  111.  goto AFTER-RA
  112.  
  113. :2400_BBS
  114.  :C:
  115.  cd\RA
  116.  RA.exe -n1 -b2400 -E0
  117.  goto AFTER-RA
  118.  
  119. :1200_BBS
  120.  :C:
  121.  cd\RA
  122.  RA.exe -n1 -b1200 -E0
  123.  goto AFTER-RA
  124.  
  125. :300_BBS
  126.  :C:
  127.  cd\RA
  128.  RA.exe -n1 -b300 -E0
  129.  goto AFTER-RA
  130.  
  131. :LOCALBBS
  132.  :C:
  133.  cd\RA
  134.  RA.exe -n1 -L -E0
  135.  goto AFTER-RA
  136.  
  137. :AFTER-RA
  138.  rem   ***** AFTER_RA traps the errorlevel exits from RA *****
  139.  if errorlevel 20 goto OUTSIDE
  140.  if errorlevel 10 goto START
  141.  if errorlevel  5 goto NET&ECHO
  142.  if errorlevel  4 goto ECHOONLY
  143.  if errorlevel  3 goto NETONLY
  144.  if errorlevel  2 goto LOCALBBS
  145.  if errorlevel  1 echo INITIALIZATION ERROR!  Modem Init failed or NO FOSSIL!   
  146.  echo ATH1>COM2:
  147.  REM All this section does is to update the Files.BBS because of the
  148.  REM Weird way I use a CD-ROM
  149.  listem
  150.  call fbconv.bat
  151.  REM End Weird Stuff
  152.  goto END-RA
  153.  
  154. :rem Outside routines requiring exit from RA to run (saves RAM).
  155. :rem Put stuff that exited ra with an errorlevel here!
  156. :rem -===========================================================-
  157.  
  158.  rem prevent accidental drop to DOS through batch
  159.  goto start
  160. :OUTSIDE
  161.  if errorlevel 0 goto tuit
  162. :tuit 
  163.  prompt Outside_(exit returns)$p$g 
  164.  c:\command.com
  165.  cd \RA
  166.  prompt $p$g
  167.  ctty con 
  168.   goto restart-RA
  169.  
  170. :RESTART-RA
  171.  :C:
  172.  CD \RA
  173.  RA.exe -n1 -r 
  174.   goto AFTER-RA
  175.  
  176. :NET&ECHO
  177.  :C:
  178.  cd \RA
  179.  Imail Scan
  180.  IMPACK 1:all 2:all via 1:3627/101
  181. :ECHOONLY
  182.  :C:
  183.  cd \RA
  184.  Imail Scan
  185.  goto end-RA
  186.  
  187. :NETONLY
  188.  :C:
  189.  cd \RA
  190.  Imail Scan
  191.  IMPACK 1:all 2:all via 1:3627/101 
  192.  goto end-RA
  193.  
  194. :END-RA
  195.  cls
  196.  cd\ra
  197.  goto start
  198.  
  199. :UNPACKMAIL
  200.  :C:
  201.  cd\RA
  202.  echo **** Unpacking mail; exit from FD errorlvl 70;  F7 manually ****
  203.  IMAIL TOSS /N
  204.  rem IMAIL 1:all 2:all 3:all via 1:3627/101
  205.  IMTHINGS IMPORT
  206.  GOTO START
  207.  if not exist C:\netfiles\nodediff.* goto nexttest
  208. :PARSE
  209.   echo    ........... Nodediff found... Processing Nodelist .......... 
  210.   cd \netfiles
  211.   for %%F IN (nodediff.???) Do Echo %%F Weekly Nodelist Change File >> \fidonet\files.bbs
  212.   cd \RA\nodelist
  213.   copy \netfiles\nodediff.* C:\RA\NODELIST 
  214.   pkunpak/r \netfiles\nodediff.*
  215.   del \netfiles\nodediff.*
  216.   parselst
  217.   del nodediff.*
  218.   pkzip -m \fidonet\nodelist.zbs nodelist.bbs
  219. :killist
  220.   cd \RA\nodelist
  221.   del nodelist.f*
  222.   killist
  223.   md temp
  224.   for %%F  in (nodelist.???) do zip \nodelist\temp\%%F nodelist.???
  225.   cd temp
  226.   rename nodelist.??? nodelist.z??
  227.   for %%F in (nodelist.???) do echo %%F Weekly Compiled Nodelist "Zipped" >> \fidonet\files.bbs
  228.   copy nodelist.??? \fidonet
  229.   del nodelist.???
  230.   cd \RA
  231.   RAnode
  232.   cd \fd
  233.   fdnc
  234. :nexttest
  235.   echo    ........... Checking for received File Lists ...............
  236.   if not exist d:\netfiles\f3627_*.* goto nextst2
  237.   copy \netfiles\f3627_*.* \fidonet
  238.   del \netfiles\f3627_*.*
  239. :nextst2
  240.   goto START
  241.  
  242. :TOSSNET
  243.  :C:
  244.  cd\RA
  245.  echo **** Toss net-mail; Manual exit from FD Errorlvl 80  ****
  246.  Imail Toss
  247.  goto START
  248.  
  249. :SCANECHO
  250.  :C:
  251.  cd\RA
  252.  echo ***** Echo Mail Scan; Manual exit from FD Errorlvl 90 *****
  253.  IMAIL SCAN
  254.  goto START
  255. :SCAN 
  256.  SCAN C: D: /A /M /REPORT C:\RA\LOGS\REPORT.TXT 
  257.  GOTO START
  258. :CLEANUP
  259.  :C:
  260.  cd\RA
  261.  echo **** Cleanup; Auto exit FD, 4am event FD Errorlvl 60 ****
  262.  RAmsg -L
  263.  RAmsg -Icru
  264.  RAmsg -PKRA
  265.  RAuser -V -S -P -D90 -M50
  266.  rem IMTHINGS KILL /D10 /N50 /P
  267.  :DAILY
  268.  echo * Special Daily Maintenance Routines  *
  269.  :C:
  270.  cd\RA
  271.  SCAN C: D: /A /M
  272.  dlc150.exe
  273.  call logmaint.bat
  274.  goto start
  275.  rem ***** Some basic error codes in case we get in trouble *****
  276. :FOSSIL
  277.  echo.
  278.  echo.
  279.  Echo Wrong Fossil Version Error|goto END
  280. :MODEMINIT
  281.  echo.
  282.  echo.
  283.  Echo Unable To Initialize Modem|goto END
  284. :MODEMRESP
  285.  echo.
  286.  echo.
  287.  Echo Modem Not Responding|goto END
  288. :FULLDISK
  289.  echo.
  290.  echo.
  291.  Echo Insufficient Disk Space To Proceed|goto END
  292. :EXTERNAL
  293.  echo.
  294.  echo.
  295.  Echo External Error - System File Missing|goto END
  296. :INTERNAL
  297.  echo.
  298.  echo.
  299.  Echo Internal Error
  300. :END
  301.  REM Take the phone Off the Hook when I'm trying to work in DOS.
  302.  echo ATH1>COM2:
  303.  cd \RA
  304.  echo.
  305.  echo.
  306.  echo.
  307.  echo.
  308.  echo.
  309.  echo ...... outta there!
  310.  
  311.